Micron Document
🎖️GitЯра🎖️

Node / meshtastic / Meshtastic-Android / files / app / src / main / java / com / geeksville / mesh / repository / radio / InterfaceFactory.kt

Displaying Raw • Download

app/src/main/java/com/geeksville/mesh/repository/radio/InterfaceFactory.kt ui_message_list (be3f882f) Text, 2.08 KB

T8b949e/*
* Copyright (c) 2025 Meshtastic LLC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

Tff7b72package T7ee787com.geeksville.mesh.repository.radio

Tff7b72import T7ee787javax.inject.Inject
Tff7b72import T7ee787javax.inject.Provider

T8b949e/**
* Entry point for create radio backend instances given a specific address.
*
* This class is responsible for building and dissecting radio addresses based upon
* their interface type and the "rest" of the address (which varies per implementation).
*/
Tff7b72class T56d364InterfaceFactory Tf0883e@Inject Tff7b72constructorTb4b4b4(
Tff7b72private Tff7b72val Te6edf3nopInterfaceFactoryTb4b4b4: Te6edf3NopInterfaceFactoryTb4b4b4,
Tff7b72private Tff7b72val Te6edf3specMapTb4b4b4: Te6edf3MapTff7b72<Te6edf3InterfaceIdTb4b4b4, Tf0883e@JvmSuppressWildcards Te6edf3ProviderTff7b72<Te6edf3InterfaceSpecTff7b72<Tff7b72*Tff7b72>Tff7b72>Tff7b72>
Tb4b4b4) Tb4b4b4{
Tff7b72internal Tff7b72val Te6edf3nopInterface Tff7b72by Te6edf3lazy Tb4b4b4{
Te6edf3nopInterfaceFactoryTb4b4b4.Te6edf3createTb4b4b4(Ta5d6ff"Ta5d6ff"Tb4b4b4)
Tb4b4b4}

Tff7b72fun Td2a8fftoInterfaceAddressTb4b4b4(Te6edf3interfaceIdTb4b4b4: Te6edf3InterfaceIdTb4b4b4, Te6edf3restTb4b4b4: Tffa657StringTb4b4b4)Tb4b4b4: Tffa657String Tb4b4b4{
Tff7b72return Ta5d6ff"Tffd700${Te6edf3interfaceIdTb4b4b4.Te6edf3idTffd700}Tffd700$Te6edf3restTa5d6ff"
Tb4b4b4}

Tff7b72fun Td2a8ffcreateInterfaceTb4b4b4(Te6edf3addressTb4b4b4: Tffa657StringTb4b4b4)Tb4b4b4: Te6edf3IRadioInterface Tb4b4b4{
Tff7b72val Tb4b4b4(Te6edf3specTb4b4b4, Te6edf3restTb4b4b4) Tff7b72= Te6edf3splitAddressTb4b4b4(Te6edf3addressTb4b4b4)
Tff7b72return Te6edf3specTff7b72?.Te6edf3createInterfaceTb4b4b4(Te6edf3restTb4b4b4) Tff7b72?: Te6edf3nopInterface
Tb4b4b4}

Tff7b72fun Td2a8ffaddressValidTb4b4b4(Te6edf3addressTb4b4b4: Tffa657String?Tb4b4b4)Tb4b4b4: Tffa657Boolean Tb4b4b4{
Tff7b72return Te6edf3addressTff7b72?.Te6edf3let Tb4b4b4{
Tff7b72val Tb4b4b4(Te6edf3specTb4b4b4, Te6edf3restTb4b4b4) Tff7b72= Te6edf3splitAddressTb4b4b4(Tffa657itTb4b4b4)
Te6edf3specTff7b72?.Te6edf3addressValidTb4b4b4(Te6edf3restTb4b4b4)
Tb4b4b4} Tff7b72?: Tff7b72false
Tb4b4b4}

Tff7b72private Tff7b72fun Td2a8ffsplitAddressTb4b4b4(Te6edf3addressTb4b4b4: Tffa657StringTb4b4b4)Tb4b4b4: Te6edf3PairTff7b72<Te6edf3InterfaceSpecTff7b72<Tff7b72*Tff7b72>Tff7b72?Tb4b4b4, Tffa657StringTff7b72> Tb4b4b4{
Tff7b72val Te6edf3c Tff7b72= Te6edf3addressTff7b72[T79c0ff0Tff7b72]Tb4b4b4.Te6edf3let Tb4b4b4{ Te6edf3InterfaceIdTb4b4b4.Te6edf3forIdCharTb4b4b4(Tffa657itTb4b4b4) Tb4b4b4}Tff7b72?.Te6edf3let Tb4b4b4{ Te6edf3specMapTff7b72[Tffa657itTff7b72]Tff7b72?.Te6edf3getTb4b4b4(Tb4b4b4) Tb4b4b4}
Tff7b72val Te6edf3rest Tff7b72= Te6edf3addressTb4b4b4.Te6edf3substringTb4b4b4(T79c0ff1Tb4b4b4)
Tff7b72return Te6edf3PairTb4b4b4(Te6edf3cTb4b4b4, Te6edf3restTb4b4b4)
Tb4b4b4}
Tb4b4b4}

Served by rngit 1.5.0 - Generated in 0.04s